home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / X_DIRS.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  56 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   X_DIRS  .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. $INCLUDE "DAS-NB01.INC"
  19. $INCLUDE "DAS-NB02.INC"
  20. COLOR 7,0
  21. CLS
  22.  
  23. ? "┌────────────────────────────────────────────────────────────────────────
  24. ? "│ fDIR$    ( Mask$, Attributes?, Fields? )
  25. ? "│ fDIRlist%( F$(), Mask$, Attributes?, Fields?, Sorted% )
  26. ? "├────────────────────────────────────────────────────────────────────────
  27. ? "│ Let's start with fDIR$ as it explains most of fDIRlist% anyhow!
  28. ? "│ It is almost like PowerBASIC's DIR$ but it provides 2 extra services:
  29. ? "│   1) it will skip any file or directory that does not match Attributes?
  30. ? "│   2) it returns a formatted file listing where Fields? is a bit-mapped
  31. ? "│      request voucher! Bits 0 thru 4 activate different fields.
  32. ? "│ fDIRlist% uses fDIR$ to fill the array. Although it will not go past
  33. ? "│ UBOUND( F$(1) ) it will continue to find matches and return the actual
  34. ? "│ count even if it is greater than UBOUND( F$() ). This lets the program
  35. ? "│ know if it needs to allocate more array elements and call the function
  36. ? "│ again.
  37. ? "└────────────────────────────────────────────────────────────────────────
  38.  
  39. Fields? = 0
  40. DO
  41.   PRINT USING "Fields? = ## "; Fields?;
  42.   PRINT fDIR$( "*.*", 32, Fields? ); "<<<<<<"
  43.   SHIFT LEFT Fields?, 1
  44.   INCR Fields?, 1
  45. LOOP UNTIL Fields? > &b00011111
  46.  
  47. LOCATE 25, 69 : PRINT "THUMP A KEY"; : fAnyKey : CLS
  48.  
  49. DIM F$(10)
  50. Fields? = 1   ' EVERYTHING!
  51. Last% = fDIRlist%( F$(), "*.*", 48, Fields?, -1 )
  52.  
  53. FOR X% = 1 TO MIN( Last%, 10 )      ' notice the MIN not MAX
  54.   PRINT F$(X%)
  55. NEXT
  56.